package com.wjp.dinosaur.util;

import io.jsonwebtoken.Claims;

import javax.servlet.http.HttpServletRequest;

public class UserIdUtil {

    public static Long getUserId(HttpServletRequest request){
        String token = request.getParameter("token");
        Claims claims = JWTUtils.parseJWT(token);
        System.out.println(claims.get("userId"));
        return (Long) claims.get("userId");
    }
}
